/**
 * Created by Roman on 2016/5/12.
 */
public class FizzBuzzWhizzHandler implements IWordHandler {

    private IWordHandler nextHandler;

    @Override
    public void setNext(IWordHandler wordHandler) {
        this.nextHandler = wordHandler;
    }

    @Override
    public String handle(int num) {
        if (Integer.toString(num).contains("3")  && num % 5 == 0 && num % 7 == 0) {
            return "FizzBuzzWhizz";
        }
        return nextHandler.handle(num);
    }
}
